package CreationModel.AbstractFactoryModel;


/**
 * @author 王蕾 [wanglei_dev@cyou-inc.com]
 * @date 2017-11-23 11:24:00
 */
public interface IFactory {

    IUser createUser();

    IDepartment createDepartment();
}

class SqlFactory implements IFactory{
    @Override
    public IUser createUser() {
      return new SqlServerUser();
    }

    @Override
    public IDepartment createDepartment() {
        return new SqlServerDepartment();
    }
}

class AccessFactory implements IFactory{
    @Override
    public IUser createUser() {
        return new AccessServerUser();
    }

    @Override
    public IDepartment createDepartment() {
        return new AccessServerDepartment();
    }
}
